/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * FrmAplaz.java
 *
 * Created on 19/02/2011, 01:44:54 AM
 */
package interfaz1;

import java.util.ConcurrentModificationException;
import java.util.ListIterator;

/**
 *
 * @author CLIENTE
 */
public class FrmAplaz extends javax.swing.JFrame {

    /** Creates new form FrmAplaz */
    public FrmAplaz() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTabAplaz = new javax.swing.JTable();
        btngenerarapla = new javax.swing.JButton();
        btnsaliraplz = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Listados");
        getContentPane().setLayout(null);

        jLabel1.setFont(new java.awt.Font("Bookman Old Style", 1, 12));
        jLabel1.setText("Estudiantes Aplazados");
        getContentPane().add(jLabel1);
        jLabel1.setBounds(140, 30, 160, 20);

        jTabAplaz.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Cedula", "Nombre", "Apellido", "Nota Final"
            }
        ));
        jScrollPane1.setViewportView(jTabAplaz);

        getContentPane().add(jScrollPane1);
        jScrollPane1.setBounds(50, 60, 310, 180);

        btngenerarapla.setText("Generar");
        btngenerarapla.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btngeneraraplaActionPerformed(evt);
            }
        });
        getContentPane().add(btngenerarapla);
        btngenerarapla.setBounds(100, 260, 80, 23);

        btnsaliraplz.setText("Salir");
        btnsaliraplz.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnsaliraplzActionPerformed(evt);
            }
        });
        getContentPane().add(btnsaliraplz);
        btnsaliraplz.setBounds(230, 260, 80, 23);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-416)/2, (screenSize.height-336)/2, 416, 336);
    }// </editor-fold>//GEN-END:initComponents

    private void btnsaliraplzActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnsaliraplzActionPerformed

        dispose();
        // TODO add your handling code here:
    }//GEN-LAST:event_btnsaliraplzActionPerformed

    private void btngeneraraplaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btngeneraraplaActionPerformed

        FrmOperacionesseccion.getMiseccion().ListadoReprobados(FrmOperacionesseccion.getMiestudiante(), FrmOperacionesseccion.getMiprofesor());
        ListIterator<Estudiante> it = FrmOperacionesseccion.getMiseccion().list_aux.listIterator();
        int indice = 0;
        while (it.hasNext()) {
            Estudiante e = new Estudiante();
            e = it.next();
            if (FrmOperacionesseccion.getMiprofesor().AsignarEstado(e).equals("Reprobado")) {
                FrmOperacionesseccion.getMiseccion().list_aux.add(e);
                jTabAplaz.setValueAt(e.getCedula(), indice, 0);
                jTabAplaz.setValueAt(e.getNombre(), indice, 1);
                jTabAplaz.setValueAt(e.getApellido(), indice, 2);
                jTabAplaz.setValueAt(e.getNotaf(), indice, 3);
                indice++;

            }
        }
    }//GEN-LAST:event_btngeneraraplaActionPerformed

    /**
     * @param args the command line arguments
     */
    static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new FrmAplaz().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btngenerarapla;
    private javax.swing.JButton btnsaliraplz;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTabAplaz;
    // End of variables declaration//GEN-END:variables
}
